# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SOURCEDIR     = ./
BUILDDIR      = _build

PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
ERROROPTS       = -W --keep-going

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile create_rst_examples

clean:
	rm -rf $(BUILDDIR)/*
               
latex:
	"$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) 
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
	@echo "Run \`make' in that directory to run these through (pdf)latex" \
	"(use \`make latexpdf' here to do that automatically)."

html:
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

ditaxml:
	pip3 install --upgrade --force-reinstall git+https://gitlab.devtools.intel.com/document-publishing/sphinx2dita#egg=sphinx2dita 
	$(SPHINXBUILD) -b ditaxml $(ALLSPHINXOPTS) $(BUILDDIR)/ditaxml
	@echo
	@echo "Build finished. The ditaxml files are in $(BUILDDIR)/ditaxml."